<%@ page language="java" import="java.util.*,java.io.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%!
private static final String TITLE="页面底部";
//读取计数器文件
public int load(String path){
	int temp=0;
	try{
	File f = new File(path);
	BufferedReader buf = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
	String str = buf.readLine();
	temp = Integer.parseInt(str);
	buf.close();
	}catch(Exception e){};
	return temp;	
}
//保存计数器文件
public synchronized void save(int c,String path){ //需要同步
	try{
		File f = new File(path);
		PrintStream ps = new PrintStream(new FileOutputStream(f));
		ps.print(c);
		ps.close();
	}catch(Exception e1){}
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  
    <base href="${ctx }">
    
    <title><%=TITLE %></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="css/layout.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
 <%
 	String strPath = getServletContext().getRealPath("/")+"js\\count.txt";
	int count=load(strPath);
	if (session.isNew()){
		save(++count,strPath);
	}
 %>
  <div id="footer">
  	<div class="footer_ft">
  	<dl>
  	<dt><a href="login.jsp">用户登陆</a>　||　<a href="#">产品目录</a>　||　<a href="#">联系我们</a>　||　<a href="#">友情链接</a>　||　<a href="#">关于我们</a>　||　<a href="#">广告合作</a></dt>
  	<dd>今天你是第[<%=count %>]位浏览者</dd>
  	</dl>
  	</div>
  </div>
  </body>
</html>
